Companion

object Companion

Functions

Link copied to clipboard

Adds another test, and potentially another error, to a Validation.

Link copied to clipboard
fun <T> error(storedVal: T, error: String): ValidationResult<T>

Create a validation result with this if there was a problem during validation.

Link copied to clipboard
Link copied to clipboard
fun <T> predicated(storedVal: T, valid: Boolean, error: String): ValidationResult<T>

Convenience shortcut for creating a success or error depending on a boolean state.

Link copied to clipboard

reports error, if any, to a provided reporter (such as a logger)

reports error, if any, to a provided string list

Link copied to clipboard
fun <T> success(storedVal: T): ValidationResult<T>

Creates a successful validation result.

Link copied to clipboard

Creates a new ValidationResult of type T wrapping the new value with the error(if any) from the receiver ValdiationResult (of any type, does not need to match T)